<%-- 
    Document   : lookup
    Created on : Aug 28, 2011, 7:20:03 PM
    Author     : krisada
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="/WEB-INF/jsrpc.tld" prefix="jsrpc"%>
<%@taglib uri="/WEB-INF/workforce.tld" prefix="work"%>
<!DOCTYPE html>



<jsrpc:broker>
    <jsrpc:register id="service" bean="workforce.limousine.service.DriverManager"/>
    <script language="JavaScript" type="text/javascript" src="js/ui.js"></script>    
    <script language="JavaScript" type="text/javascript" src="js/JTable.js"></script>
    <script language="JavaScript" type="text/javascript" src="js/table.js"></script>
    <script language="JavaScript" type="text/javascript" src="js/validation.js"></script>
    <script language="JavaScript" type="text/javascript" src="js/util.js"></script>

    <script language="JavaScript" type="text/javascript" src="js/driver.js"></script>
</jsrpc:broker>



<jsrpc:script base="<%=request.getServletPath()%>"/>

<script language="JavaScript" type="text/javascript">
    <!--
    function initPage() {
    <%
                //String s = this.
                String s = request.getServletPath();
                System.out.println("login.jsp[" + s + "]");
                String sp[] = s.split("/");
                System.out.println("size:" + sp.length);
                StringBuffer sf = new StringBuffer();
                for (int i = 2; i < sp.length; i++) {
                    //System.out.println("["+ sp[i]+"]");
                    // sf.append("../");
                }
                session.setAttribute("BACK_PATH", sf.toString());
                sf.append("BROKER-REGISTER");
                System.out.println("path[" + sf.toString() + "]");
    %>
            initBroker("<%=sf.toString()%>");

            /*var search = document.getElementById("formSearch");
            search.style.visibility = "visible";
            var panel = document.getElementById("panel");
            search.style.top = panel.style.top;
            search.style.left = panel.style.left;*/
          formSearch();
                      
        }        
        -->
</script>

<body onload="initPage()">
    <div class="data_form" >
        <div class="head_data_form">
        </div>

        <div class="show_form">

            <table width="100%" border="0" cellspacing="10" cellpadding="0">
                <tr>
                    <td><strong>Driver</strong></td>
                </tr>
                <tr>
                    <td>

                        <form action="/" id="actionForm" name="actionForm" >
                            <div id="panel" style="visibility: visible"></div>


                            <fieldset><legend><strong id="fieldSetLabel" >Driver Search</strong></legend>
                                <jsp:include page="sys_msg.jsp" />

                                

                                <div id="formEntry" style="visibility: hidden; ">
                                    <table width="100%" border="0">
                                        <work:field-hidden id="tableId" name="tableId"/>
                                        <tr>
                                            <td align="right" width="35%"><work:label text="ID"/></td>
                                            <td><work:field-id id="driverId" name="driverId" /></td>
                                        </tr>
                                        <tr>
                                            <td align="right"><work:label text="Driver Name"/></td>
                                            <td><work:text id="driverName"  tooltipText="Name of Lookup use<br> Separate in group id."/></td>
                                        </tr>
                                        <tr>
                                            <td align="right"><work:label text="Driver Type"/></td>
                                            <td><work:text id="driverType" tooltipText="Value of Lookup use<br> Separate in group id."/></td>
                                        </tr>
                                        <tr>
                                            <td align="right" valign="top"><work:label text="Driver Rate" style="vertical-align: top"/></td>
                                            <td><work:text id="driverRate" tooltipText="Description of Lookup use Separate in group id."/></td>
                                        </tr>
                                        <tr>
                                            <td align="right"><work:label text="Per Type"/></td>
                                            <td><work:text id="perType" tooltipText="Group name of Lookup use Separate in group id."/></td>
                                        </tr>
                                        <tr>
                                            <td align="right"><work:label text="Account No"/></td>
                                            <td><work:text id="accountNo" tooltipText="Order of Lookup use Separate in group id."/></td>
                                        </tr>
                                        <tr>
                                            <td align="right"><work:label text="Bank"/></td>
                                            <td><work:text id="bank" tooltipText="Order of Lookup use Separate in group id."/></td>
                                        </tr>
                                        <tr>
                                            <td align="right"><work:label text="Status"/></td>
                                            <td><work:text id="status" tooltipText="Order of Lookup use Separate in group id."/></td>
                                        </tr>
                                        <tr>
                                            <td align="right"><work:label text="Create By"/></td>
                                            <td><work:text id="createBy" tooltipText="Order of Lookup use Separate in group id."/></td>
                                        </tr>
                                        <tr>
                                            <td align="right"></td>
                                            <td><work:field-hidden id="createDate" name="createDate" />
                                                <work:field-hidden id="createBy" name="createBy" />
                                                <work:field-hidden id="updateDate" name="updateDate" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="center" colspan="2">
                                                <work:button id="bSave" label="Save" onclick="insert()"/>&nbsp;
                                                <work:button id="bClear" label="Reset" onclick="setInsert()"/>&nbsp;
                                                <work:button id="bCancel" label="Cancel" onclick="formSearch()"/>
                                            </td>
                                        </tr>
                                    </table>

                                </div>

                                <div id="formSearch" style="display: block; visibility: hidden; position: relative; top: -300px">

                                    <table width="100%" border="0">
                                        <tr>
                                            <td align="right" width="35%"><work:label text="Driver Name"/></td>
                                            <td><work:text id="tDriverName" tooltipText="Name of Lookup use<br> Separate in group id."/>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="center" colspan="2">
                                                <work:button id="bSearch" label="Search" onclick="search(0)"/>&nbsp;
                                                <work:button id="bAdd" label="Add New" onclick="setInsert()"/>&nbsp;
                                                <work:button id="bValidate" label="Validation" onclick="verify()"/>
                                            </td>
                                        </tr>
                                    </table>
                                    <br>
                                    <div id="data" style="position: relative; overflow: auto;">
                                        <fieldset><legend><strong>Data</strong></legend>
                                            <table id="tableData" width="100%" align="center" >
                                                <thead id="tableDataHeader">
                                                </thead>
                                                <tbody id="tableDataBody" style="overflow: auto">
                                                </tbody>
                                                <tfoot id="tableDataFooter"></tfoot>
                                            </table>
                                        </fieldset>
                                    </div>


                                </div>

                            </fieldset>

                        </form>


                    </td>
                </tr>
            </table>

        </div>

        <div class="bottom_data_form">
        </div>

    </div>
</body>

